import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

// 定义路由规则
const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "Dashboard",
    component: () => import("@/components/VisitDashboard.vue"),
  },
  {
    path: "/create-plan",
    name: "VisitPlanCreate",
    component: () => import("@/components/VisitPlanCreate.vue"),
  },
  {
    path: "/process",
    name: "VisitProcess",
    component: () => import("@/components/VisitProcess.vue"),
  },
  {
    path: "/assistant",
    name: "VisitAssistant",
    component: () => import("@/components/VisitAssistant.vue"),
  },
  {
    path: "/report",
    name: "VisitReport",
    component: () => import("@/components/VisitReport.vue"),
  },
  {
    path: "/feedback",
    name: "VisitFeedback",
    component: () => import("@/components/VisitFeedback.vue"),
  },
  {
    path: "/batch-create",
    name: "BatchVisitPlanCreate",
    component: () => import("@/components/BatchVisitPlanCreate.vue"),
  },
  {
    path: "/customer/:id",
    name: "CustomerDetail",
    component: () => import("@/components/CustomerDetail.vue"),
    props: true,
  },
];

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
